package com.atguigu.daijia.map.service;

import com.atguigu.daijia.model.form.map.OrderServiceLocationForm;
import com.atguigu.daijia.model.form.map.SearchNearByDriverForm;
import com.atguigu.daijia.model.form.map.UpdateDriverLocationForm;
import com.atguigu.daijia.model.form.map.UpdateOrderLocationForm;
import com.atguigu.daijia.model.vo.map.NearByDriverVo;
import com.atguigu.daijia.model.vo.map.OrderLocationVo;
import com.atguigu.daijia.model.vo.map.OrderServiceLastLocationVo;

import java.math.BigDecimal;
import java.util.List;

/**
 * @author 谢忠涵7
 */
public interface LocationService {
    /**
     * @description: 根据司机个性化设置搜索附近5公里满足条件的司机
     * @author: xiaoxie
     * @date: 2024/10/26 23:10
     * @param: [searchNearByDriverForm] 搜索条件
     * @return: List<NearByDriverVo> 附件符合添加的司机列表
     **/
    List<NearByDriverVo> searchNearByDriver(SearchNearByDriverForm searchNearByDriverForm);
    /**
     * @description: 司机开启接单服务：更新司机经纬度位置
     * @author: xiaoxie
     * @date: 2024/10/26 22:48
     * @param: [updateDriverLocationForm] 新司机经纬度位置数据
     * @return: 是否成功
     **/
    Boolean updateDriverLocation(UpdateDriverLocationForm updateDriverLocationForm);
    /**
     * @description: 关闭接单服务：删除司机经纬度位置
     * @author: xiaoxie
     * @date: 2024/10/26 22:49
     * @param: [driverId] 司机id
     * @return: 是否成功
     **/
    Boolean removeDriverLocation(Long driverId);
    /**
     * @description: 司机赶往代驾起始点：更新订单地址到缓存
     * @author: xiaoxie
     * @date: 2024/10/29 14:42
     * @param: [updateOrderLocationForm]
     * @return: Boolean
     **/
    Boolean updateOrderLocationToCache(UpdateOrderLocationForm updateOrderLocationForm);

    /**
     * @description: 司机赶往代驾起始点：获取订单经纬度位置
     * @author: xiaoxie
     * @date: 2024/10/29 15:03
     * @param: [orderId]
     * @return: OrderLocationVo
     **/
    OrderLocationVo getCacheOrderLocation(Long orderId);

    /**
     * @description: 开始代驾服务：保存代驾服务订单位置 批量保存到MongoDB中
     * @author: xiaoxie
     * @date: 2024/10/30 20:02
     * @param: [orderLocationServiceFormList]
     * @return: java.lang.Boolean
     **/
    Boolean saveOrderServiceLocation(List<OrderServiceLocationForm> orderLocationServiceFormList);

    /**
     * @description: 代驾服务：获取订单服务最后一个位置信息
     * @author: xiaoxie
     * @date: 2024/10/30 20:11
     * @param: [orderId]
     * @return: OrderServiceLastLocationVo
     **/
    OrderServiceLastLocationVo getOrderServiceLastLocation(Long orderId);

    /**
     * @description: 代驾服务：计算订单实际里程
     * @author: xiaoxie
     * @date: 2024/10/30 21:08
     * @param: [orderId]
     * @return: java.math.BigDecimal
     **/
    BigDecimal calculateOrderRealDistance(Long orderId);
}
